<%@ page contentType="text/html;charset=UTF-8" %>
<%--<%@ include file="/WEB-INF/views/include/taglib.jsp"%>--%>
<html>
<head>
    <title>移动双录地图展示</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript"
            src="http://api.map.baidu.com/api?v=2.0&ak=bo3inVQyf5dT2Xxbuk3tl47TjXKGI1E1"></script>
    <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>

    <style type="text/css">
        body, html {
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
        }

        #allmap {
            width: 100%;
            height: 500px;
        }

        p {
            margin-left: 5px;
            font-size: 14px;
        }

        img {
            height: 25px;
            min-width: 39px;
            vertical-align: middle;
            border: 0;
            -ms-interpolation-mode: bicubic
        }
    </style>

</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="javascript:;">移动双录地图展示</a></li>
    <%--<li class="active"><a href="${ctx}/mobile/mobileFile/form">视频播放</a></li>--%>
</ul>

<div id="allmap"></div>

<script type="text/javascript">
    // 百度地图API功能
    map = new BMap.Map("allmap");
    map.centerAndZoom(new BMap.Point(116.417854, 39.921988), 13);
    //获取当前城市，根据城市定位
    var myCity = new BMap.LocalCity();
    myCity.get(myFun);
    function myFun(result) {
        var cityName = result.name;
        map.setCenter(cityName);
        //		alert("当前定位城市:"+cityName);
    }
    setTimeout(function () {
        map.setZoom(13);
    }, 2000);  //2秒后放大到15级
    map.enableScrollWheelZoom(true);

    var data_info = ${locationList};

    var opts = {
        width: 250,     // 信息窗口宽度
        height: 80,     // 信息窗口高度
        title: "用户坐标及文件名", // 信息窗口标题
        enableMessage: false//设置允许信息窗发送短息
    };
    for (var i = 0; i < data_info.length; i++) {

        var marker = new BMap.Marker(new BMap.Point(data_info[i][0], data_info[i][1]));  // 创建标注
        var content = data_info[i][2];
        map.addOverlay(marker);               // 将标注添加到地图中
        marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
        addClickHandler(content, marker);
    }
    function addClickHandler(content, marker) {
        marker.addEventListener("click", function (e) {
                    openInfo(content, e)
                }
        );
    }
    function openInfo(content, e) {
        var p = e.target;
        var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
        var infoWindow = new BMap.InfoWindow(content, opts);  // 创建信息窗口对象
        map.openInfoWindow(infoWindow, point); //开启信息窗口
    }
</script>


<div class="form-actions">
    <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>

</body>
</html>

